Parameters
- Min
- The pixel value to be mapped to the first element of the Colours array
- Max
- The pixel value to be mapped to the last element of the Colours array
- Colours
- An array of Color values
The alpha values are central to Volume rendering, and it is important that "transparent" pixel ranges should be to colours with an alpha value < 1.
Pixel values less than the Min value are mapped to the first colour in the array and those greater than the Max value are mapped to the last value.
DicomImage image = new DicomImage("your_3D_dicom_image.dcm"); DicomVolume volume = new DicomVolume(image); RenderMode3D renderMode = RenderMode3D.MPR; DicomImage3D image3D = new DicomImage3D(volume, renderMode); // Typical pixel range for 12 bit CT float minPixelValue = -1024; float maxPixelValue = 3071; Color[] colorMap = new Color[] { Color.FromArgb(0, 0, 0, 0), // Fully transparent black (Air) Color.FromArgb(50, 0, 0, 255), // Slightly visible blue Color.FromArgb(100, 0, 255, 0), // Green (soft tissue) Color.FromArgb(200, 255, 0, 0), // Red (high-intensity structures) Color.FromArgb(255, 255, 255, 255) // Fully opaque white (Bone) }; image3D.SetTransferFunction(minPixelValue, maxPixelValue, colorMap); Viewer.Images.Add(image3D);